﻿using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Shapes;

namespace PropertyExpression.PresentationCode.CodeGenerator
{
    internal class Program
    {
        static void Main()
        {
            var configuration = new BuilderConfiguration();

            configuration.Add(typeof(Thickness), new OverloadedMethodBuilderByConstructor());
            configuration.Add(typeof(Point), new OverloadedMethodBuilderByConstructor());
            configuration.Add(typeof(PropertyPath), new OverloadedMethodBuilderByConstructor());
            configuration.Add(typeof(FontFamily), new OverloadedMethodBuilderByConstructor());

            configuration.Add(typeof(FontWeight), new PrefixMethodBuilderBySpecifiedType(typeof(FontWeights)));
            configuration.Add(typeof(Brush), new PrefixMethodBuilderBySpecifiedType(typeof(Brushes)));
            configuration.Add(typeof(Cursor), new PrefixMethodBuilderBySpecifiedType(typeof(Cursors)));

            configuration.Add(typeof(GridLength), new OverloadedMethodBuilderByConstructor(), new PrefixMethodBuilderByPropertyType());

            File.WriteAllText(@"..\..\..\PresentationCode\GeneratedCode.cs",
                              new Generator(configuration).Generate(
                                  new[]
                                      {
                                          typeof (ContentControl),
                                          typeof (Window),
                                          typeof (RowDefinition),
                                          typeof (ColumnDefinition),
                                          typeof (Grid),
                                          typeof (SolidColorBrush),
                                          typeof (TextBlock),
                                          typeof (TextBox),
                                          typeof (FrameworkElement),
                                          typeof (Style),
                                          typeof (LinearGradientBrush),
                                          typeof (GradientStop),
                                          typeof (Binding),
                                          typeof (DataTrigger),
                                          typeof (RelativeSource),
                                          typeof (DataTemplate),
                                          typeof (Setter),
                                          typeof (Trigger),
                                          typeof (Control),
                                          typeof (TextElement),
                                          typeof (ListBoxItem),
                                          typeof (StackPanel),
                                          typeof (Ellipse),
                                          typeof (Label),
                                          typeof (System.Windows.Shapes.Path),
                                          typeof (Border)
                                      }
                                  ).ToString());

        }
    }
}